import request from "@/utils/request.js";
import type { UserForm, ApiResponse,userInfoType, LoginResponse } from './type.ts';

// 登录
export function login(data: UserForm): Promise<ApiResponse<LoginResponse>> {
    return request({
        url: '/login',
        method: 'post',
        data,
    });
}

// 获取用户信息
export function getUser():Promise<ApiResponse<userInfoType>>{
    return request({
        url:'/userInfo',
        method:'get',
    })
}